package com.live.stamp.base.validation;

import org.springframework.boot.container.core.common.BusinessException;
import org.springframework.boot.container.core.log.ZKLogger;
import org.springframework.boot.container.core.log.ZKLoggerFactory;

/**
 * null验证处理器
 */
public class NullHandle extends ParamHandler {
    private static final ZKLogger logger = ZKLoggerFactory.getLogger(NullHandle.class);
    @Override
    protected ValidationEnum getParamHandleType() {
        return ValidationEnum.NUL;
    }

    @Override
    protected void echo(String paramName, Object param) {
        if(param == null){
            logger.error("param is null!");
            throw new BusinessException("参数为空");
        }
    }
}
